Skip to content

Lab02#2

Open
ellilin wants to merge 2 commits intomasterfrom
lab02
Open

Lab02#2
ellilin wants to merge 2 commits intomasterfrom
lab02

Conversation

@ellilin
Copy link
Owner

@ellilin ellilin commented Feb 4, 2026

No description provided.

Main Tasks (Python app):
- Add production-ready Dockerfile with best practices
  - Non-root user (appuser)
  - Specific base image version (python:3.13-slim)
  - Proper layer ordering for caching
  - Health check implementation
- Create .dockerignore for optimized build context
- Add Docker section to README.md with usage examples
- Create comprehensive LAB02.md documentation
- Push image to Docker Hub (ellilin/devops-info-service:v1.0.0)
- Final image size: 208MB

Bonus Task (Go app - Multi-stage build):
- Implement multi-stage Dockerfile for Go application
  - Stage 1: Builder (golang:1.21-alpine) for compilation
  - Stage 2: Runtime (alpine:3.19) for minimal footprint
  - Static binary with stripped symbols (-ldflags='-s -w')
- Create .dockerignore for Go
- Build 31.6MB final image (91% smaller than single-stage)
- Push to Docker Hub (ellilin/devops-info-service-go:v1.0.0)
- Create detailed LAB02.md documentation explaining:
  - Multi-stage strategy and benefits
  - Size comparison analysis
  - Security implications
  - Technical explanation of each stage

Security:
- Both apps run as non-root user
- Minimal base images for reduced attack surface
- No build tools in production images
- Proper health checks implemented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant